<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>选择模式集</title>
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<link rel="stylesheet" href="../styles/table.css" type="text/css" />
<script src="../script/common.js"></script>
<script type="text/javascript">
$import("rpc.js");
$import("table_list.js");

var trainSet = {};
trainSet.id = null;
trainSet.name = null;

function loadTrainSets()
{
	var titles = 
	[
		{text: "选择", width: "5%"}, 
		{text: "名称", width:"30%"},
		{text: "创建时间", width:"30%"}
	];
	
	var columns = 
	[
	    function(data)
		{
			var element = document.createElement("input");
			element.type = "radio";
			element.name = "trainSet_element";
			element.user = data;
			element.onclick = function()
			{
				trainSet.id = data.id;
				trainSet.name = data.name;
			};
			return element;
		}, 
		function(data) { return data.name; },
		function(data) { return data.createTime; }
	];
	
	var operation = new Operation("GBID.列所有模式集");
	var tableList = new TableList(operation, titles, columns);
	tableList.create($("container"));
	tableList.refresh();
}

function onOk()
{
	if (!trainSet.id) 
	{
		alert("你没有选中任何模式集！");
		return;
	}
	
	window.returnValue = trainSet;
	window.close();
}

function onCancel()
{
	window.returnValue = null;
	window.close();
}

function onLoad()
{
	loadTrainSets();
}
</script>
</head>
<body onLoad="onLoad();">
<div id="ur_here"><img src="../images/icon_here.gif" style="align:absmiddle" align="absmiddle"/> 当前位置：首页 » 选择模式集 </div>
<div id="wrap">
<div id="containaer" >
	<div class="title" id="result">
		请在下面的列表中选择所需的模式集
	</div>
	<!-- 结果展示div -->
	<div id="container"></div> 
	<table cellpadding=0 cellspacing=0 border=0 width="100%">
		<tr>
			<td class="buttom_div">
				<input class="form_ok" type="button" onClick="onOk();"/>
       			<input class="form_back" type="button" onClick="onCancel();"/>
	  		</td>
		</tr>
	</table>
</div>
</div>
</body>
</html>